Release 10.1A: OpenEdge Development:
ADM and SmartObjects
SmartDataField usage notes
This section discusses special programming considerations for using SmartDataFields.
Creating SmartDataFields
Because SmartDataFields do not have a wizard, you must create them yourself. Here are the general steps for creating a SmartDataField, which you perform in the AppBuilder:
- Define the visualization of the SmartDataField; for example, by dropping an ActiveX Control onto it.
- Write code to set the
DataModifiedproperty; for example, when the field’s value is changed in anAfterUpdateActiveX event trigger.- Implement the
setDataValueandgetDataValuefunctions (the template includes stubs for these functions):
- The
setDataValuefunction, which is run from displayFields in the SmartDataViewer, sets the value of the field’s visualization by passing in the SmartDataObject field value to be assigned to the visualization.- The
getDataValuefunction returns the current value of the field’s visualization to the caller (typicallycollectChangesin the SmartDataViewer).- To signal the Table-IO source that the user modified data, create a
VALUE-CHANGEDtrigger for the SmartDataField that contains the following single line:
{set DataModified yes}- Implement the
disableFieldandenableFieldprocedures to enable and disable the visualization (the template includes stubs for these procedures). There also areDisplayFieldandEnableFieldproperties:
- The
displayFieldproperty specifies whether the data value for the field is assigned to the SmartDataField automatically.- The
enableFieldproperty specifies whether the SmartDataField is updateable.By default, these properties are set based on the corresponding properties for the original SmartDataObject field, but they can be set in the instance properties dialog box.
- Modify the use list for the SmartDataField icon in the
smart.cstfile to include your special SmartDataField. This enables you to reuse your SmartObject by selecting it from the AppBuilder palette.For instructions on using the AppBuilder, see OpenEdge Development: AppBuilder .
Adding SmartDataFields to SmartDataViewers
You add SmartDataFields to a SmartDataViewer after you pick all of the fields that will appear in the viewer (using the wizard). To add a SmartDataField, select it from the AppBuilder palette and drop it onto the SmartDataObject field it is to replace. As when you add SmartObjects to other SmartContainers, the AppBuilder then generates an
adm-create-objectsprocedure to start the SmartDataField, including aFieldNameproperty whose value is the name of the original SmartDataObject field.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |